﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class voteshow : System.Web.UI.Page
{
    public DataTable vdt = new DataTable();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string id = ltModel.Str.CkeckID(Request["id"]);
            if (id.Length > 7)
            {
                Response.Write("<script>alert('参数有误！');window.location='index.aspx';</script>");
                return;
            }
            ltModel.Model.Class cbo = new ltModel.Model.Class();
            cbo = new ltModel.BLL.Class().GetModel(Int32.Parse(id));
            if (cbo != null)
            {
                lbltitle.Text = cbo.title;
                vdt = new ltModel.BLL.vote().GetList("[class]=" + id + " order by [id] asc ").Tables[0];
                for (int i = 0; i < vdt.Rows.Count; i++)
                    lblCounts.Text = (Int32.Parse(lblCounts.Text) + Int32.Parse(vdt.Rows[i]["count"].ToString())).ToString();
            }
            else
            {
                Response.Write("<script>alert('不存在该编号！');window.location='index.aspx';</script>");
                return;
            }
        }
    }
}
